package com.ruoyi.qiushi.service.user.impl;

import java.util.List;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.qiushi.domain.user.MemberHealthRecord;
import com.ruoyi.qiushi.mapper.user.MemberHealthRecordMapper;
import com.ruoyi.qiushi.service.user.IMemberHealthRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 健康档案/病历资料Service业务层处理
 *
 * @author ruoyi
 * @date 2023-12-08
 */
@Service
public class MemberHealthRecordServiceImpl implements IMemberHealthRecordService {
    @Autowired
    private MemberHealthRecordMapper memberHealthRecordMapper;

    /**
     * 查询健康档案/病历资料
     *
     * @param id 健康档案/病历资料主键
     * @return 健康档案/病历资料
     */
    @Override
    public MemberHealthRecord selectMemberHealthRecordById(Long id) {
        return memberHealthRecordMapper.selectMemberHealthRecordById(id);
    }

    /**
     * 查询健康档案/病历资料列表
     *
     * @param memberHealthRecord 健康档案/病历资料
     * @return 健康档案/病历资料
     */
    @Override
    public List<MemberHealthRecord> selectMemberHealthRecordList(MemberHealthRecord memberHealthRecord) {
        return memberHealthRecordMapper.selectMemberHealthRecordList(memberHealthRecord);
    }

    /**
     * 新增健康档案/病历资料
     *
     * @param memberHealthRecord 健康档案/病历资料
     * @return 结果
     */
    @Override
    public int insertMemberHealthRecord(MemberHealthRecord memberHealthRecord) {
        memberHealthRecord.setCreateTime(DateUtils.getNowDate());
        return memberHealthRecordMapper.insertMemberHealthRecord(memberHealthRecord);
    }

    /**
     * 修改健康档案/病历资料
     *
     * @param memberHealthRecord 健康档案/病历资料
     * @return 结果
     */
    @Override
    public int updateMemberHealthRecord(MemberHealthRecord memberHealthRecord) {
        memberHealthRecord.setUpdateTime(DateUtils.getNowDate());
        return memberHealthRecordMapper.updateMemberHealthRecord(memberHealthRecord);
    }

    /**
     * 删除健康档案/病历资料信息
     *
     * @param id 健康档案/病历资料主键
     * @return 结果
     */
    @Override
    public int deleteMemberHealthRecordById(Long id) {
        return memberHealthRecordMapper.deleteMemberHealthRecordById(id);
    }
}
